<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MTB CAT1 Peripheral driver library: SmartIO      (Smart I/O)</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="IFXCYP_one-line.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MTB CAT1 Peripheral driver library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__group__smartio.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#groups">API Reference</a>  </div>
  <div class="headertitle">
<div class="title">SmartIO (Smart I/O)</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<p>The Smart I/O driver provides an API to configure and access the Smart I/O hardware present between the GPIOs (pins) and HSIOMs (pin muxes) on select device ports. </p>
<p>The functions and other declarations used in this driver are in cy_smartio.h. You can include cy_pdl.h to get access to all functions and declarations in the PDL.</p>
<p>It can be used to perform simple logic operations on peripheral and GPIO signals at the GPIO port. Features include,</p>
<ol type="1">
<li>Purely combinatorial logic using 8 Look-Up Tables (LUT).</li>
<li>Mixed sequential and combinatorial logic using 8 LUTs and 1 Data Unit (DU).</li>
<li>Counters and shift registers using 8-bit multi-function DU (simplified ALU).</li>
<li>Operational in device active, sleep and deep-sleep power modes.</li>
</ol>
<h1><a class="anchor" id="group_smartio_configuration"></a>
Configuration Considerations</h1>
<h2><a class="anchor" id="group_smartio_routing_fabric"></a>
Routing Fabric</h2>
<p>The Smart I/O routing fabric is divided into two portions, where each portion is capable of accepting half of the data or GPIO signals. The LUTs have the following structure.</p>
<ul>
<li>LUT 7...4 are capable of accepting signals from io/chip 7...4 as inputs.</li>
<li>LUT 3...0 are capable of accepting signals from io/chip 3...0 as inputs.</li>
<li>The LUTs can accept any LUT output as an input.</li>
<li>Each LUT output is dedicated to the corresponding output io/chip terminal. For example, LUT 0 can go to either io0 terminal output or chip0 terminal output or both.</li>
</ul>
<h2><a class="anchor" id="group_smartio_single_lut"></a>
Single Source LUT Input</h2>
<p>If a LUT is used, all three inputs to the LUT must be designated. For example, even If a LUT is used to accept a single source as its input, all three inputs must accept that same signal. The lookup table should then be designed such that it only changes the output value when all three inputs satisfy the same condition. For example, consider the case where the signal on data0 must be inverted before being passed to io0. LUT0 accepts chip0 as input 0, 1 and 2. The truth table is defined such that it outputs a logic 1 only when the inputs are all 0.</p>
<h2><a class="anchor" id="group_smartio_clk_rst"></a>
Clock and Reset Behavior</h2>
<p>The Smart I/O hardware drives its synchronous elements using a single clock source. Depending on the clock source, the Smart I/O will have different reset behaviors, which will reset all the flip-flops in the LUTs and synchronizers to logic 0. The configuration registers will retain their values unless coming out of Power on Reset (POR). Notes:</p>
<ul>
<li>If the block is only disabled, the values in the LUT flip-flips and I/O synchronizers are held as long as the chip remains in a valid power mode.</li>
<li>The selected clock for the fabric's synchronous logic is not phase aligned with other synchronous logic on the chip operating on the same clock. Therefore, communication between the Smart I/O and other synchronous logic should be treated as asynchronous (just as the communication between I/O input signals and other synchronous logic should be treated as asynchronous)</li>
</ul>
<table class="doxtable">
<tr>
<th>Clock Source </th><th>Reset Behavior </th><th>Enable Delay </th><th>Description  </th></tr>
<tr>
<td>io/chip 7...0 </td><td>Reset on POR </td><td>2 clock edges </td><td>If chosen as the clock source, that particular signal cannot also be used as an input to a LUT as it may cause a race condition. The fabric will be enabled after 2 clock edges of the signal on the gpio terminal.  </td></tr>
<tr>
<td>Divided Clock (Active) </td><td>Reset when going to Deep Sleep, Hibernate or POR </td><td>2 clock edges </td><td>The fabric will be enabled after 2 clock edges of the divided clock. Any synchronous logic in the LUTs will be reset to 0 when in chip deep-sleep or hibernate modes.  </td></tr>
<tr>
<td>Divided Clock (Deep-Sleep) </td><td>Reset when going to Hibernate or POR </td><td>2 clock edges </td><td>The fabric will be enabled after 2 clock edges of the divided clock. Any synchronous logic in the LUTs will be reset to 0 when in hibernate mode.  </td></tr>
<tr>
<td>Divided Clock (Hibernate) </td><td>Reset on POR </td><td>2 clock edges </td><td>The fabric will be enabled after 2 clock edges of the divided clock.  </td></tr>
<tr>
<td>LFCLK </td><td>Reset when going to Hibernate and POR </td><td>2 clock edges </td><td>The fabric will be enabled after 2 clock edges of the low frequency clock (LFCLK). Any synchronous logic in the LUTs will be reset to 0 when in hibernate mode.  </td></tr>
<tr>
<td>Asynchronous </td><td>Reset on POR </td><td>3 clock edges of SYSCLK </td><td>The fabric will be enabled after 3 clock edges of the clk_peri source.  </td></tr>
</table>
<h2><a class="anchor" id="group_smartio_sync_req"></a>
Signal Synchronization Requirement</h2>
<p>If any of the signals coming in through the Smart I/O terminals are meant to be used in sequential elements in the LUTs, the terminal synchronizer must first be used to synchronize that signal to the Component clock. For example, if the signal on io0 must be used in LUT0 in Sequential output mode, the synchronization for io0 terminal should be enabled for reliable operation.</p>
<h2><a class="anchor" id="group_smartio_comb_feedback"></a>
LUT Combinatorial Feedback</h2>
<p>Since the LUTs can be configured as purely (or partially) combinatorial elements and since they can chain to each other in any fashion, combinatorial timing loops can occur. This causes oscillations that burn power and create unpredictable behavior. If a feedback is required, the signals should always go through a flip-flop before feeding back. For example, the following is a potentially problematic design; LUT1 and LUT2 are configured in combinatorial mode, where their respective outputs feed into the inputs of the other. This will result in oscillations. To prevent it, one of the LUTs should be configured to Gated Output mode.</p>
<h2><a class="anchor" id="group_smartio_lpm"></a>
Low Power Mode</h2>
<p>The Smart I/O hardware is capable of operating during chip Deep-Sleep mode. The block has the following requirements when operating in this mode:</p>
<ul>
<li>All sequential elements must be clocked by a valid clock in these power domains. Refer to <a class="el" href="group__group__smartio.html#group_smartio_clk_rst">Clock and Reset Behavior</a> for more details.</li>
<li>All signals in the block (including the clock) must be less than 1 MHz when in Deep-Sleep mode.</li>
<li>The hold override functionality should be enabled when entering Deep-Sleep mode. This functionality should then be disabled when the chip is not in this mode.</li>
</ul>
<h1><a class="anchor" id="group_smartio_more_information"></a>
More Information</h1>
<p>Refer to the technical reference manual (TRM) and the device datasheet.</p>
<h1><a class="anchor" id="group_smartio_changelog"></a>
Changelog</h1>
<table class="doxtable">
<tr>
<th>Version</th><th>Changes</th><th>Reason for Change </th></tr>
<tr>
<td>1.0.4 </td><td>Updated driver guards. </td><td>Driver disabled on devices that do not support SMARTIO.  </td></tr>
<tr>
<td>1.0.3 </td><td>Updated driver guards. </td><td>Support Added for future devices of the CAT1B.  </td></tr>
<tr>
<td>1.0.2 </td><td>Documented MISRA 2012 violations. </td><td>MISRA 2012 compliance.  </td></tr>
<tr>
<td>1.0.1 </td><td>Minor documentation updates. </td><td>Documentation enhancement.  </td></tr>
<tr>
<td>1.0 </td><td>The initial version. </td><td></td></tr>
</table>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="groups"></a>
API Reference</h2></td></tr>
<tr class="memitem:group__group__smartio__macros"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__smartio__macros.html">Macros</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__group__smartio__functions"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__smartio__functions.html">Functions</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__group__smartio__data__structures"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__smartio__data__structures.html">Data Structures</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__group__smartio__enums"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__smartio__enums.html">Enumerated Types</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>MTB CAT1 Peripheral driver library</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
